package com.example.myapplication

import android.content.Context
import androidx.multidex.MultiDex
import com.example.mylibrary.base.BaseApplication
import com.example.mylibrary.network.RetrofitUtil
import com.example.mylibrary.network.UrlConfig
import com.example.mylibrary.utils.SpUtils
import com.example.mylibrary.utils.UiTools

class MyApplication : BaseApplication() {

    companion object {
        lateinit var createService: ServerConnectApi

        fun init(context: Context) {
            RetrofitUtil.init(context, UrlConfig.PRIVATE_BASE_URL, false)
            createService = RetrofitUtil.createService(ServerConnectApi::class.java)
        }
    }

    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        MultiDex.install(this)
    }

    override fun onCreate() {
        super.onCreate()
        UiTools.initUiTools(this)
        SpUtils.init(this)
        init(this)
    }


}